//
//  NSString+ZY.m
//  01-大文件下载
//
//  Created by JamesZY on 15/8/28.
//  Copyright (c) 2015年 JamesZY. All rights reserved.
//

#import "NSString+ZY.h"

@implementation NSString (ZY)

- (NSString *)cacheDir
{
    // 1.获取cache目录
    NSString *dir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
    return [dir stringByAppendingPathComponent:[self lastPathComponent]];
}

- (NSString *)documentDir {
    // 2.获取document目录
    NSString *dir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    return [dir stringByAppendingPathComponent:[self lastPathComponent]];
}

- (NSString *)tmpDir {
    // 3.获取temp目录
    NSString *dir = NSTemporaryDirectory();
    return [dir stringByAppendingPathComponent:[self lastPathComponent]];
}

@end
